<style lang="less">
.card_style {
  height: 100%;
  width: 100%;
  overflow: hidden;
  .ivu-card-body {
    padding: 0px;
  }
}
.page_style {
  margin-top: 10px;
  text-align: right;
}
.bench_search {
  margin-bottom: 10px;
}
.nopadding .ivu-table-cell {
  padding: 0px 0px;
}
.item1{
  height: 42px;
  line-height: 40px;
}
.marginR2 {
  margin-right: 2%;
}
.fontsize20 {
  font-size: 20px;
}
.fontTitle {
  font-size: 20px;
  height: 52px;
  text-align: right;
  padding-top: 16px;
  // vertical-align: bottom;
}
.fontContent {
  font-size: 20px;
  height: 52px;
  text-align: left;
  padding-top: 16px;
  color: #dc9387;
  // vertical-align: bottom;
}
.countNum {
  font-size: 35px;
  color: #dc9387;
}
.new-btn-sty {
  margin-right: 5px;
  color: #fff;
  background-color: #235CA7;
  border-color: #235CA7;
  font-weight: 500;
}
.new-btn-sty1 {
  margin-right: 5px;
  color: #fff;
  background-color: #598ED1;
  border-color: #598ED1;
  font-weight: 500;
}
.text-overflow{
  width:300px; /* 超过宽度就显示... */
  text-overflow: ellipsis; /* 显示... */
  overflow: hidden; /* 隐藏文字 */
  white-space: nowrap; /* 不换行 */
  cursor: pointer; /* hover显示手形 */
}
.search-info-style{
  margin-top: 10px;
}
.table-input{
  border: #312e2e solid 1px;
  border-left: 0px;
  border-right: 0px;
  line-height: 50px;
}
.table-col{
  border: #312e2e solid 1px;
  line-height: 50px;
}
</style>
<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
  <div>
    <Row class="search-info-style">
      <Col span="6">
        <span style="">事项类型：</span>
        <Select v-model="searchInfo.event_type" style="width:70%">
          <Option value="">全部</Option>
          <Option value="1">新增</Option>
          <Option value="2">注销</Option>
          <Option value="3">跨街道调动</Option>
          <Option value="4">街道内调动</Option>
          <Option value="5">区内调动</Option>
          <Option value="6">跨区调动</Option>
        </Select>
      </Col>
      <Col span="6">
        <span>时间：</span>
        <DatePicker type="date" v-model="searchInfo.start_time" placeholder="选择开始时间" style="width: 30%;"></DatePicker>
        ～ <DatePicker type="date" v-model="searchInfo.end_time" placeholder="选择结束时间" style="width: 30%;"></DatePicker>
      </Col>
      <Col span="6">
        <span style="">审批人：</span>
        <Input style="width: 70%;" v-model="searchInfo.operator" />
      </Col>
<!--      <Col span="3">-->
<!--        ～ <DatePicker type="date" v-model="searchInfo.end_time" placeholder="选择结束时间" style="width: 50%;"></DatePicker>-->
<!--      </Col>-->
      <Col style="float:right" pull="1">
        <Button class="new-btn-sty" @click="init()"><Icon type="ios-search" />查询</Button>
        <Button class="new-btn-sty" @click="searchDatawork()"><Icon type="ios-search" />重置</Button>
      </Col>
    </Row>
    <Row class="search-info-style">
      <Col span="6">
        <span>流程状态：</span>
        <Select v-model="searchInfo.result" filterable transfer="" style="width: 70%;">
          <Option value="">全部</Option>
          <Option value="0">驳回</Option>
          <Option value="1">通过</Option>
          <Option value="2">审批中</Option>
        </Select>
      </Col>
<!--      <Col span="21">-->
<!--      </Col>-->
<!--      <Col span="3">-->
<!--        <Button class="new-btn-sty" @click="init">-->
<!--          <Icon type="ios-search" /> 查询-->
<!--        </Button>-->
<!--        <Button class="new-btn-sty" @click="searchDatawork">-->
<!--          <Icon type="success" /> 重置-->
<!--        </Button>-->
<!--      </Col>-->
    </Row>
    <Row>
      <Col span="24" >
        <Table border  :columns="columns" :data="datalist" ref="personSelection" style="margin-top:10px;" @on-selection-change="personSelection()">
          <template slot-scope="{ row }" slot="event_type">
            <span v-if="row.event_type == '1'">新增</span>
            <span v-if="row.event_type == '2'">注销</span>
            <span v-if="row.event_type == '3'">跨街道调动</span>
            <span v-if="row.event_type == '4'">街道内调动</span>
            <span v-if="row.event_type == '5'">区内调动</span>
            <span v-if="row.event_type == '6'">跨区调动</span>
          </template>
          <template slot-scope="{ row }" slot="state">
            <span v-if="row.state == '1'">调入地审批</span>
            <span v-if="row.state == '2'">区审批</span>
          </template>
          <template slot-scope="{ row }" slot="result">
            <span v-if="row.result == '0' && row.state == '1'">街道驳回</span>
              <span v-if="row.result == '0' && row.state == '2'">区驳回</span>
              <span v-if="row.result == '1' && row.state == '1'">街道通过</span>
              <span v-if="row.result == '1' && row.state == '2' && row.event_type != '6'">街道通过已上报到区</span>
              <span v-if="row.result == '1' && row.state == '2' && row.event_type == '6'">其他区待审批</span>
              <span v-if="row.result == '00' && row.state == '2'">区通过</span>
              <span v-if="row.result == '2' && row.state == '1'">街道待审批</span>
              <span v-if="row.result == '2' && row.state == '2'">区待审批</span>
              <span v-if="!row.result">无审批人员</span>
          </template>
          <template slot-scope="{ row }" slot="sex">
            <span v-if="row.sex == '0'">男</span>
            <span v-if="row.sex == '1'">女</span>
          </template>
        </Table>
        <Row v-if="searchInfo.loading1 == true">
          <Col class="demo-spin-col" span="8" offset="8">
            <Spin fix>
              <Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
              <div>数据正在加载</div>
            </Spin>
          </Col>
        </Row>
      </Col>
    </Row>
    <Page :total="searchInfo.totalnum" class="page_style" :current="searchInfo.currentPageNo"
          :page-size="searchInfo.currentPageSize" @on-change="changePageNo" show-total show-elevator show-sizer @on-page-size-change="changePagesize"/>
    <Modal
      v-model="processModal"
      title="流程跟踪"
      width="80%">
      <Row>
        <Col span="24" >
          <Table border  :columns="processColumns" :data="processlist" ref="personSelection" style="margin-top:10px;" @on-selection-change="personSelection()">
            <template slot-scope="{ row }" slot="state">
              <span v-if="!row.state">无结点</span>
              <span v-if="row.state == '1'">调入地审批</span>
              <span v-if="row.state == '2'">区审批</span>
              <span v-if="row.state == '3'">街道审批</span>
              <span v-if="row.state == '4'">市审批</span>
            </template>
            <template slot-scope="{ row }" slot="result">
              <span v-if="row.result == '0' && row.state == '1'">街道驳回</span>
              <span v-if="row.result == '0' && row.state == '2'">区驳回</span>
              <span v-if="row.result == '1' && row.state == '1'">街道通过</span>
              <span v-if="row.result == '1' && row.state == '2' && row.event_type != '6'">街道通过已上报到区</span>
              <span v-if="row.result == '1' && row.state == '2' && row.event_type == '6'">其他区待审批</span>
              <span v-if="row.result == '00' && row.state == '2'">通过</span>
              <span v-if="row.result == '2' && row.state == '1'">街道待审批</span>
              <span v-if="row.result == '2' && row.state == '2'">区待审批</span>
              <span v-if="row.result == '3' && row.state == '2'">审批通过</span>
              <span v-if="!row.result">无审批人员</span>
            </template>
          </Table>
          <Row v-if="searchInfo.loading1 == true">
            <Col class="demo-spin-col" span="8" offset="8">
              <Spin fix>
                <Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
                <div>数据正在加载</div>
              </Spin>
            </Col>
          </Row>
        </Col>
      </Row>
    </Modal>
    <Modal v-model="modal" title="驳回原因" :mask-closable="false">
      <form>
        <div style="text-align: center">
          驳回原因：<Input v-model="reason" type="textarea" placeholder="驳回原因" style="width: 300px" />
        </div>
      </form>
      <div slot="footer">
        <Button type="info" @click="ok()">提交</Button>
        <Button type="default" @click="closeModel()">退出</Button>
      </div>
    </Modal>

    <Modal v-model="okModel" title="通过审批-选社区提交区" :mask-closable="false">
      <form>
        <Select v-model="operator">
          <Option :value="item.code" v-for="item in mailList3" v-bind:key="item.code">{{item.name}}</Option>
<!--          <Option v-for="(item, index) in communityList" :value="item.CPSR001" :key="index">{{ item.CPSR002 }}</Option>-->
        </Select>
      </form>
      <div slot="footer">
        <Button type="info" @click="submitOk()">提交</Button>
        <Button type="default" @click="closeSubmitOk()">退出</Button>
      </div>
    </Modal>
  </div>
</template>

<script>
import { getOffice, getPersonInfoList, updatePersonnelPassInfo, updateCP, updatePersonCompanyCode, addRecord, getFlowList, getRecordList, updateFlow, getRegionList, getTypeNameList, createPersonneInfo, getPersonInfo, deleteComplaint, updatePersonneInfo, createTransfer, date2str } from '@/api/eventlist'
export default {
  data () {
    return {
      mailList1: [],
      mailList2: [],
      mailList3: [],
      modal: false,
      okModel: false,
      operator: '',
      company_code: this.$store.state.user.severUserInfo.company_code,
      level: this.$store.state.user.severUserInfo.company_grade,
      reason: '',
      datalist: [],
      addModal: false,
      updateModal: false,
      showModal: false,
      handle_time1: '',
      deleteModal: false,
      jdnddModal: false,
      kjdddModal: false,
      qnddModal: false,
      kqddModal: false,
      processModal: false,
      ddInfo: {},
      addinfo: {},
      updateinfo: {},
      showinfo: {},
      row: '',
      deleteInfo: {},
      handleInfo: {},
      searchInfo: {
        applytime: [],
        currentPageNo: 1,
        currentPageSize: 10,
        loading1: true
      },
      reginList: [[], [], []],
      dictList: [[], [], []],
      processlist: [],
      communityList: [],
      columns: [
        {
          type: 'index',
          width: 50,
          align: 'center'
        },
        // {
        //   type: 'selection',
        //   width: 60,
        //   align: 'center'
        // },
        { title: '审批流程', key: 'event_type', width: 150, align: 'center', slot: 'event_type' },
        { title: '发起人员', key: 'company_name', width: 150, align: 'center' },
        { title: '发起时间', key: 'create_time', width: 160, align: 'center' },
        { title: '社工姓名', key: 'CPBI003', width: 150, align: 'center' },
        { title: '性别', key: 'sex', slot: 'sex', width: 80, align: 'center' },
        { title: '身份证号', key: 'cardno', minWidth: 160, align: 'center' },
        { title: '审批人员', key: 'operator_name', width: 150, align: 'center' },
        { title: '流程状态', slot: 'result', width: 150, align: 'center' },
        { title: '操作',
          key: 'action',
          minWidth: 250,
          align: 'center',
          render: (h, params) => {
            let temp = []
            temp.push(
              h('Button', {
                props: { type: 'info', size: 'small' },
                style: { marginRight: '5px', marginTop: '2px', marginBottom: '2px' },
                on: {
                  click: () => {
                    this.getFlowItem(params.row.id)
                  }
                }
              }, '流程跟踪')
            )
            temp.push(
              h('Button', {
                props: { type: 'error', size: 'small' },
                style: { marginRight: '5px', marginTop: '2px', marginBottom: '2px' },
                on: {
                  click: () => {
                    this.back(params.row)
                  }
                }
              }, '驳回')
            )
            // state: 1街道  ， state：2区
            if (params.row.put_place && params.row.state == '1' && params.row.level != '3') {
              temp.push(
                h('Button', {
                  props: { type: 'info', size: 'small' },
                  style: { marginRight: '5px', marginTop: '2px', marginBottom: '2px' },
                  on: {
                    click: () => {
                      this.selectCom(params.row)
                    }
                  }
                }, '选社区通过')
              )
            }
            // else if (params.row.put_place && params.row.state == '1' && params.row.level == '3') {
            //   temp.push(
            //     h('Button', {
            //       props: { type: 'info', size: 'small' },
            //       style: { marginRight: '5px', marginTop: '2px', marginBottom: '2px' },
            //       on: {
            //         click: () => {
            //           this.submitCityOk(params.row)
            //         }
            //       }
            //     }, '通过上报区')
            //   )
            // }
            else if (params.row.put_place && params.row.state == '2' && this.level !== '2' && params.row.event_type === '6') {
              temp.push(
                h('Button', {
                  props: { type: 'info', size: 'small' },
                  style: { marginRight: '5px', marginTop: '2px', marginBottom: '2px' },
                  on: {
                    click: () => {
                      this.cityPass(params.row)
                    }
                  }
                }, '区通过')
              )
            }else if (params.row.put_place && params.row.state == '2' && this.level !== '2' && params.row.event_type === '3') {
              temp.push(
                h('Button', {
                  props: { type: 'info', size: 'small' },
                  style: { marginRight: '5px', marginTop: '2px', marginBottom: '2px' },
                  on: {
                    click: () => {
                      this.cityPass2(params.row)
                    }
                  }
                }, '通过')
              )
            } else if (this.level === '2') {
              temp.push(
                h('Button', {
                  props: { type: 'info', size: 'small' },
                  style: { marginRight: '5px', marginTop: '2px', marginBottom: '2px' },
                  on: {
                    click: () => {
                      this.shiPass(params.row)
                    }
                  }
                }, '市通过')
              )
            } else {
              // 新增的不用选社区直接通过
              temp.push(
                h('Button', {
                  props: { type: 'info', size: 'small' },
                  style: { marginRight: '5px', marginTop: '2px', marginBottom: '2px' },
                  on: {
                    click: () => {
                      if (confirm('是否确定通过？')) {
                        updatePersonnelPassInfo(params.row).then(ret => {
                          if (ret.data.errcode === 0) {
                            this.$Notice.success({title: '审批通过', desc: ""})
                            this.init()
                          } else {
                            this.$Notice.error({title: '审批失败', desc: ret.data.errmsg})
                          }
                        })
                      }
                    }
                  }
                }, '直接通过')
              )
            }
            return h('div', temp)
          }
        }
      ],
      processColumns: [
        {
          title: '序号',
          type: 'index',
          width: 50,
          align: 'center'
        },
        { title: '流程节点', slot: 'state', minWidth: 110, align: 'center' },
        { title: '提交时间', key: 'send_time', minWidth: 120, align: 'center' },
        { title: '发起人员', key: 'send_name', minWidth: 120, align: 'center' },
        { title: '社工人员', key: 'CPBI003', minWidth: 120, align: 'center' },
        { title: '审批人员', key: 'company_name', minWidth: 130, align: 'center' },
        { title: '审批状态', slot: 'result', minWidth: 100, align: 'center' },
        { title: '审批时间', key: 'create_time', minWidth: 120, align: 'center' },
        { title: '审批意见', key: 'reason', minWidth: 220, align: 'center' }
      ]
    }
  },
  methods: {
    submitOk() {
      // if(!this.operator) {
      //   this.$Notice.error({
      //     title: '社区不可为空'
      //   })
      //   return
      // }
      if(!this.operator) {
        this.operator = this.row.out_place
      }
      let data = {
        id: this.row.id,
        result: '1',
        state: '2',
        operator: this.$store.state.user.severUserInfo.parent_code,
        out_place: this.operator
      }
      updateFlow(data).then(ret => {
        if (ret.data.errcode === 0) {
          this.$Notice.success({
            title: '成功',
            desc: ret.data.errmsg
          })
          this.operator = ''
          this.okModel = false
          // this.updatePerson('submitOk')
          this.init()
        } else {
          this.$Notice.error({
            title: '失败',
            desc: ret.data.errmsg
          })
        }
      })
      // 这个给区报
      this.insertLogs('1');
    },
    // 直接报到区
    submitCityOk() {
      let data = {
        id: this.row.id,
        result: '1',
        state: '2',
        operator: this.$store.state.user.severUserInfo.parent_code,
        out_place: this.row.out_place
      }
      updateFlow(data).then(ret => {
        if (ret.data.errcode === 0) {
          this.$Notice.success({
            title: '成功',
            desc: ret.data.errmsg
          })
          // this.updatePerson('submitOk')
          this.init()
        } else {
          this.$Notice.error({
            title: '失败',
            desc: ret.data.errmsg
          })
        }
      })
      // 这个给区报
      this.insertLogs('1');
    },
    goBack(){
      let data = {
        pid: this.row.pid,
        cp: '11' // 更改状态正常
      }
      updateCP(data).then(ret => {
        if (ret.data.errcode === 0) {
          this.init()
        } else {
          this.$Notice.error({
            title: '修改人员状态失败',
            desc: ret.data.errmsg
          })
        }
      })
    },
    closeSubmitOk(){
      this.operator = ''
      this.okModel = false
    },
    // 选社区通过
    selectCom(row) {
      this.okModel = true
      this.row = row
      let data = {
        id: this.company_code
      }
      getRegionList(data).then(ret => {
        if (ret.data.errcode === 0) {
          this.communityList = ret.data.data
        } else {
          this.$Notice.error({
            title: '获取社区失败',
            desc: ret.data.errmsg
          })
        }
      })
    },
    searchDatawork () {
      this.searchInfo = {}
      this.init()
    },
    shiPass(row) {
      this.row = row
      this.backReason('00')
      this.insertLogs('00')
      this.updatePerson('cityPass')
    },
    // 区通过
    cityPass(row) {
      this.row = row
      // this.backReason('00')
      // this.insertLogs('00')
      // this.updatePerson('cityPass')
      if(!this.operator) {
        this.operator = this.row.out_place
      }
      let data = {
        id: row.id,
        result: '3',
        state: '2',
        operator: this.$store.state.user.severUserInfo.parent_code,
        // out_place: this.operator
      }
      updateFlow(data).then(ret => {
        if (ret.data.errcode === 0) {
          this.$Notice.success({
            title: '成功',
            desc: ret.data.errmsg
          })
          this.operator = ''
          this.okModel = false
          // this.updatePerson('submitOk')
          this.init()
        } else {
          this.$Notice.error({
            title: '失败',
            desc: ret.data.errmsg
          })
        }
      })
      // 这个给区报
      this.insertLogs('3');
    },

    cityPass2(row) {
      this.row = row
      this.backReason('00')
      this.insertLogs('00')
      this.updatePerson('cityPass')
    },
    // 街道通过-等待区通过啊
    go (row) {
      this.row = row
      this.backReason('1');
      this.insertLog('1');
      // this.updatePerson('go')
    },
    // 驳回提交
    ok () {
      if (!this.reason) {
        this.$Notice.error({
          title: '原因不可为空',
          desc: '原因不可为空'
        })
        return
      }
      this.backReason('0');
      if(this.level == '3') {
        this.insertLogs('0');
      }else{
        this.insertLog('0');
      }
      this.goBack()
    },
    closeModel () {
      this.reason = ''
      this.modal = false
    },
    // 通过
    backReason(v) {
      let data = {
        reason: this.reason,
        result: v,
        id: this.row.id
      }
      if (this.level === '2') {
        data.state = '4'
      }
      updateFlow(data).then(ret => {
        if (ret.data.errcode === 0) {
          if(v == '00' || v == '1') {
            this.$Notice.success({title: '操作成功',desc: ''})
          }else{
            this.$Notice.success({title: '驳回成功',desc: ''})
          }
          this.reason = ''
          this.modal = false
          this.init()
        } else {
          if(v == '00' || v == '1') {
            this.$Notice.success({title: '操作失败',desc: ''})
          }else{
            this.$Notice.success({title: '驳回失败',desc: ''})
          }
        }
      })
    },
    // 区驳回记录
    insertLogs(v) {
      let data = {
        flow_id: this.row.id,
        state: '2',
        result: v,
        reason: this.reason,
        approved_by: this.company_code
      }
      addRecord(data).then(ret => {
        if (ret.data.errcode === 0) {

        } else {
          this.$Notice.error({
            title: '插入日志失败',
            desc: ret.data.errmsg
          })
        }
      })
    },
    // 街道驳回记录
    insertLog(v) {
      let data = {
        flow_id: this.row.id,
        state: '1',
        result: v,
        reason: this.reason,
        approved_by: this.company_code
      }
      addRecord(data).then(ret => {
        if (ret.data.errcode === 0) {

        } else {
          this.$Notice.error({
            title: '插入日志失败',
            desc: ret.data.errmsg
          })
        }
      })
    },
    // 终止审批成功后进行调用
    updatePerson(str) {
      let data = {
        id: this.row.id,
        pid: this.row.pid,
      }
      if(str == 'submitOk') {
        data.community = this.operator
      } else if(str == 'cityPass' && this.row.event_type == '6') {
        // 1社区，2街道, 3级别工作者协会
        if(this.row.level) {
          if(this.row.level == '3') {
            data.city = this.row.out_place
          } else if (this.row.level == '2') {
            data.streets = this.row.out_place
          } else if (this.row.level == '1') {
            data.community = this.row.out_place
          }
        }else{
          data.community = this.row.out_place
        }
      } else if(str == 'cityPass' && this.row.event_type == '3') {
        // 跨街道调动
        if(this.row.level) {
          if(this.row.level == '3') {
            data.city = this.row.out_place
          } else if (this.row.level == '2') {
            data.streets = this.row.out_place
          } else if (this.row.level == '1') {
            data.community = this.row.out_place
          }
        }else{
          data.community = this.row.out_place
        }
      }
      data.common = '11'
      updatePersonCompanyCode(data).then(ret => {
        if (ret.data.errcode === 0) {

        } else {
          this.$Notice.error({
            title: '插入日志失败',
            desc: ret.data.errmsg
          })
        }
      })
    },
    back(row) {
      this.row = row
      this.modal = true
    },
    // 查看详情
    getFlowItem(id) {
      this.processModal = true
      let parasm = {
        id: id
      }
      getRecordList(parasm).then(ret => {
        if (ret.data.errcode === 0) {
          this.processlist = ret.data.data
        } else {
          this.$Notice.error({
            title: '查询失败',
            desc: ret.data.errmsg
          })
        }
      })
    },
    init () {
      this.searchInfo.loading1 = true
      this.datalist = []
      let parasm = {
        ...this.searchInfo,
        put_place: '1',
        result: '2',
        start_time: date2str(this.searchInfo.start_time),
        end_time: date2str(this.searchInfo.end_time),
        'pageNo': this.searchInfo.currentPageNo,
        'pageSize': this.searchInfo.currentPageSize
      }
      if (this.$store.state.user.severUserInfo.company_grade === '2') {
        parasm.result = '3'
        parasm.oper = this.company_code
      }
      // 如果为区查result: 1
      if(this.level == '3') {
        parasm.result = '1'
        parasm.oper = this.company_code
      }
      getFlowList(parasm).then(ret => {
        if (ret.data.errcode === 0) {
          this.searchInfo.totalnum = ret.data.data.totalRecord
          let data = []
          this.datalist = ret.data.data.results
          this.searchInfo.loading1 = false
        } else {
          this.$Notice.error({
            title: '查询失败',
            desc: ret.data.errmsg
          })
        }
      })
    },
    changePagesize (pageSize) {
      this.searchInfo.currentPageSize = pageSize
      this.changePageNo()
    },
    changePageNo (pageNo) {
      this.searchInfo.currentPageNo = pageNo
      this.init()
    },
    getMailList (grade, code) {
      // this.searchInfo['grade' + (index + 1)] = 0
      getOffice({ grade: grade, code: code }).then(res => {
        if (res.data.errcode === 0) {
          this.mailList1 = res.data.data
          let xiehui = {code: "1", name: "社区工作者协会", master: "社区工作者协会"}
          this.mailList1.push(xiehui)
          // this.mailList[index].unshift({ id: 0, title: '全部' })
          // this.$forceUpdate()
        } else {
          this.$Notice.error({ title: '获取信息失败', desc: '查询区域列表信息失败' })
        }
      })
    },
    getMailList2 (grade, code) {
      // this.searchInfo['grade' + (index + 1)] = 0
      getOffice({ code: code }).then(res => {
        if (res.data.errcode === 0) {
          if (grade === 4) {
            this.mailList2 = res.data.data
            let xiehui = {code: "1", name: "社区工作者协会", master: "社区工作者协会"}
            this.mailList2.push(xiehui)
          } else if (grade === 5) {
            this.mailList3 = res.data.data
          }
          // this.mailList[index].unshift({ id: 0, title: '全部' })
          // this.$forceUpdate()
        } else {
          this.$Notice.error({ title: '获取信息失败', desc: '查询区域列表信息失败' })
        }
      })
    }
  },
  mounted () {
    this.init()
    console.log(this.$store.state.user.severUserInfo)
    if (this.companyGrade < 3) {
      this.getMailList(2, null)
    } else if (this.companyGrade < 4) {
      this.getMailList2(4, this.companyCode)
    } else if (this.companyGrade < 5) {
      this.getMailList2(5, this.companyCode)
    }
  },
  computed: {
    companyGrade () {
      return this.$store.state.user.severUserInfo.company_grade
    },
    companyCode () {
      return this.$store.state.user.severUserInfo.company_code
    }
  }
}
</script>
